package org.modulefusion.example.jpa.ipojo.personclient;

import org.apache.felix.ipojo.annotations.Component;
import org.apache.felix.ipojo.annotations.Requires;
import org.modulefusion.example.jpa.personprovider.Person;
import org.modulefusion.example.jpa.personprovider.PersonService;

@Component(immediate=true)
public class PersonClient {

    @Requires
	private PersonService personService;
    
	public PersonClient() {
		System.out.println("1) Saved persons #: " + personService.getPersonList().size());
		Person person = new Person();
		person.setFirstname("clement");
		person.setLastname("escoffier");
		personService.savePerson(person);
		System.out.println("2) Saved persons #: " + personService.getPersonList().size());
	}

}
